package com.tulele.vtool.mapper;

import com.tulele.vtool.model.BargainParticipantsInfo;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import java.util.List;

@Component(value = "bargainParticipantsInfoMapper")
public interface BargainParticipantsInfoMapper {

    /**
     * 添加活动参与者信息
     * @param bargainParticipantsInfo
     * @return
     */
    int addBargainParticipantsInfo(BargainParticipantsInfo bargainParticipantsInfo);

    /**
     * 更新活动参与者信息
     * @param bargainParticipantsInfo
     * @return
     */
    int updateBargainParticipantsInfo(BargainParticipantsInfo bargainParticipantsInfo);

    /**
     * 根据砍价活动ID获取对应参与者信息
     * @param bargainActId
     * @return
     */
    List<BargainParticipantsInfo> queryBargainParticipantsInfoByActId(Integer bargainActId);

    /**
     * 根据砍价活动ID获取最新砍价的3名用户信息
     * @param bargainActId
     * @return
     */
    List<BargainParticipantsInfo> querySpecialSizeBargainParticipantsInfoByActId(Integer bargainActId);

    /**
     * 查询用户对应活动的砍价金额
     * @param userId
     * @param bargainActId
     * @return
     */
    Integer queryUserBargainAmountByActId(@Param("userId")Integer userId, @Param("bargainActId")Integer bargainActId);
}